<template>
	<!-- 公司简介部分 -->
	<view class="companyInfoWp">
		<view v-if="companyData">
			<view class="swiperWp" v-if="companyData && companyData.swiperList && companyData.swiperList.length>0">
				<u-swiper :list="companyData.swiperList" height="320rpx" circular autoplay indicator bgColor="#F7F8FA"
					@click="showCompanyFullImg" :interval="3000"></u-swiper>
			</view>
      <view class="videoWp" v-if="companyData && companyData.video && !wxCheckType">
        <video :src="companyData.video" controls></video>
      </view>
			<view class="contentWp">
				<u-parse :content="companyData.content" :selectable="true" />
			</view>
		</view>
		<view v-else style="min-height:100%">
			<nodata nodataText="未设置或公司未审核"></nodata>
		</view>

	</view>
</template>

<script>
import {
  mapState
} from 'vuex'
	export default {
		name: "companyIndex",
		data() {
			return {

			};
		},
		props: {
			companyData: {
				type: Object,
				required: true,
			},

		},
    computed: {
      ...mapState(['wxCheckType']),
    },
		methods: {
			showCompanyFullImg(i) {
				if (this.companyData.swiperList.length > 0) {
					let urls = this.companyData.swiperList.map(item => {
						return item.filePath
					})
					uni.previewImage({
						urls,
						current: i,
					})
				}

			},
		}
	}
</script>

<style lang="scss" scoped>
	.titleWp {
		background-color: #f8f9ff;
		height: 80upx;
		display: flex;
		align-items: center;
		overflow: hidden;

		.colorBlock {
			background-color: $u-primary;
			width: 20upx;
			height: 100%;
			margin-right: 20upx;
		}

		.mainTitle {
			font-weight: 600;
		}
	}

	.companyInfoWp {

		.contentWp {
			margin: 0 30upx;
		}

		.swiperWp {
			margin: 0 auto;
			width: 686rpx;
			height: 320rpx;
			margin-bottom: 16rpx;
			background-color: #F7F8FA;
		}
    .videoWp {
      margin: 20upx 0;

      video {
        width: 100%;
        border-radius: 10upx;
      }
    }
	}
</style>
